function contact_submit()
{
	if(document.getElementById("contact_txtName").value == ""){
		document.getElementById("contact_txtName").focus();
		alert("กรุณาใส่ชื่อผู้ส่งด้วยค่ะ");
		return;
	}
	else if(document.getElementById("contact_txtPhone").value == "" ){
		document.getElementById("contact_txtPhone").focus();
		alert("กรุณาใส่เบอร์โทร์ติดต่อด้วยค่ะ");
		return;
	}
	else if(document.getElementById("contact_txtEmail").value == "")
	{
		document.getElementById("contact_txtEmail").focus();
		alert("กรุณาใส่อีเมลล์ติดต่อด้วยค่ะ");
		return;
	}
	else if(document.getElementById("contact_txtTitle").value == "")
	{
		document.getElementById("contact_txtTitle").focus();
		alert("กรุณาใส่เรื่องที่ติดต่อด้วยค่ะ");
		return;
	}
	else if(document.getElementById("contact_txtDescription").value == "")
	{
		document.getElementById("contact_txtDescription").focus();
		alert("กรุณาใส่รายละเอียดด้วยค่ะ");
		return;
	}
	else{
		document.getElementById("name").value = document.getElementById("contact_txtName").value;
		document.getElementById("phone").value = document.getElementById("contact_txtPhone").value;
		document.getElementById("email").value = document.getElementById("contact_txtEmail").value;
		document.getElementById("company").value = document.getElementById("contact_txtCompany").value;
		document.getElementById("title").value = document.getElementById("contact_txtTitle").value;
		document.getElementById("description").value = document.getElementById("contact_txtDescription").value;
		document.getElementById("ispostback").value = document.getElementById("captcha").value;
		document.forms["formSubmit"].submit();
	}
}
function contact_reset()
{
	document.getElementById("contact_txtName").value = "";
	document.getElementById("contact_txtPhone").value = "";
	document.getElementById("contact_txtEmail").value = "";
	document.getElementById("contact_txtTitle").value = "";
	document.getElementById("contact_txtDescription").value = "";
}
function redirectPageComplete()
{	
	alert("ทำรายการติดต่อสำเร็จ ขอบคุณค่ะ");
	location = "contact.php";
}

function redirectPageIncomplete()
{
	alert("เกิดข้อผิดพลาดในการเพิ่มข้อมูล");
	location = "contact.php";
}